﻿using housingsafety.server.Helpers;
using housingsafety.server.Models;
using housingsafety.server.Svcs;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using Minio;
using System;
using System.IO;
using System.Threading.Tasks;

namespace housingsafety.server.SvcImpls
{
    class MinioStorageProvider : IStorageProvider
    {
        private readonly MinioClient minioClient;

        public MinioStorageProvider(IOptions<MinioOptions> minioOptions)
        {
            minioClient = new MinioClient(minioOptions.Value.Endpoint
                , minioOptions.Value.AccessKey, minioOptions.Value.SecretKey);
        }

        public string ProviderName => "Minio";

        public Task<string> CopyObjectFile(FilePath storePath, string userName, string groupName)
        {
            throw new System.NotImplementedException();
        }

        public Task<string> CopyObjectFile2FileStore(FilePath storePath, string userName, string groupName)
        {
            throw new System.NotImplementedException();
        }

        public Task<bool> DeleteObjectByNameAsync(FilePath storePath, string userName, string groupName)
        {
            throw new System.NotImplementedException();
        }

        public bool ExistFile(FilePath storePath, string userName, string groupName)
        {
            throw new System.NotImplementedException();
        }

        public Task<string> GetGateWayUrl(HttpContext context)
        {
            throw new System.NotImplementedException();
        }
        
        public Task<byte[]> GetObjectByteAsync(FilePath storePath, string userName, string groupName)
        {
            throw new System.NotImplementedException();
        }

        public Task<Stream> GetObjectStreamAsync(FilePath storePath, string userName, string groupName)
        {
            throw new System.NotImplementedException();
        }

        public Task<RespRet<FileIndex>> StoreFormFileAsync(IFormFile formFile, string userName, string groupName)
        {
            throw new System.NotImplementedException();
        }

        public Task<RespRet<FileIndex>> StoreObjectByteAsync(byte[] objectByte, string objectName, string userName, string groupName)
        {
            throw new System.NotImplementedException();
        }

        public Task<RespRet<FileIndex>> StoreObjectStreamAsync(Stream objectStream, string objectName, string userName, string groupName)
        {
            throw new System.NotImplementedException();
        }

        public async Task<Stream> GetObjectStreamAsyncYt(FilePath storePath, string userName, string groupName)
        {
            return null;
        }
        public string fileurl()
        {
            return "";
        }

        public async Task<RespRet<FileIndex>> StoreFormFileAsyncYt(IFormFile formFile, string userName, string groupName)
        {
            return null;
        }

        public bool ExistFileYt(FilePath storePath, string userName, string groupName)
        {
            throw new NotImplementedException();
        }
    }
}